{% extends 'layout.html' %}

{% block content %}
        <div class="container">
        <div style="margin-bottom: 10px">
            <a class="btn btn-success" href="/user/add/" >
                <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
                新建用户
            </a>

        </div>

        <div class="panel panel-default">
      <!-- Default panel contents -->
      <div class="panel-heading">

          <span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>
          用户列表
      </div>

      <!-- Table -->
      <table class="table table-bordered">
        <thead>
          <tr>
            <th>ID</th>
            <th>用户名</th>
              <th>密码</th>
            <th>类型</th>
            <th>手机号</th>
            <th>微信号</th>
            <th>QQ号</th>
            <th>余额</th>
            <th>创建时间</th>
              <th>创建人</th>
              <th>操作</th>
          </tr>
        </thead>
        <tbody>
        {% for field in queryset %}
            <tr>
            <th>{{ field.id }}</th>
            <td>{{ field.name }}</td>
            <td>{{ field.password }}</td>
            <td>{{ field.get_usertype_display }}</td>
            <td>{{ field.phone_number }}</td>
            <td>{{ field.wx_number }}</td>
            <td>{{ field.qq_number }}</td>
            <td>{{ field.account }}</td>
            <td>{{ field.create_time|date:"Y-m-d H:i:s" }}</td>
            <td>{{ field.create_person }}</td>
            <td>
                <a class="btn btn-primary btn-xs" href="/user/edit/{{ field.id }}/">编辑</a>
                <a class="btn btn-danger btn-xs" href="/user/delete/{{ field.id }}/">删除</a>
            </td>

        {% endfor %}
        </tbody>
      </table>
    </div>
        <ul class="pagination" style="float:left;">
                {{ page_string }}
            </ul>
    </div>
</div>
{% endblock %}